﻿using System;
using System.Runtime.Serialization;
using Catel.Articles.Base.Data.Attributes;
using Catel.Data;
using Catel.Runtime.Serialization;

namespace Catel.Articles._01___Data_handling.Models
{
    /// <summary>
    /// RenamedObject Data object class which fully supports serialization, property changed notifications,
    /// backwards compatibility and error checking.
    /// </summary>
    [Example("Renamed object", "Shows how to allow object renaming without breaking serialization",
        SourceFileName = "/Models/RenamedObject.cs")]
    [Serializable]
    [RedirectType("Catel.Articles", "PreviousTypeName")]
    public class RenamedObject : DataObjectBase<RenamedObject>
    {
        #region Variables
        #endregion

        #region Constructor & destructor
        /// <summary>
        /// Initializes a new object from scratch.
        /// </summary>
        public RenamedObject() { }

        /// <summary>
        /// Initializes a new object based on <see cref="SerializationInfo"/>.
        /// </summary>
        /// <param name="info"><see cref="SerializationInfo"/> that contains the information.</param>
        /// <param name="context"><see cref="StreamingContext"/>.</param>
        protected RenamedObject(SerializationInfo info, StreamingContext context)
            : base(info, context) { }
        #endregion
    }
}
